<?php
/**
 * @var $product array
 */
use yii\helpers\ArrayHelper;
use app\common\helper\CommonHelper;
$arr_pic = \yii\helpers\Json::decode($product['img'],true);
$pic = ArrayHelper::getValue($arr_pic,'0');
$pic = CommonHelper::getMarketPlacePic($pic);
$arn = CommonHelper::float($product['price'] * $product['creator_commission_percent'] /100);
$creator_commission_percent = CommonHelper::float($product['creator_commission_percent']);
$price = CommonHelper::float($product['price']);
$product_sales = CommonHelper::toK($product['product_sales']);
?>
<table class="es-right" cellspacing="0" cellpadding="0" align="right" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right">
    <tbody><tr style="border-collapse:collapse">
        <td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:270px">
            <table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
                <tbody><tr style="border-collapse:collapse">
                    <td align="center" style="padding:0;Margin:0;font-size:0px"><a target="_blank" href="<?=$product['link']?>" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#0081FF;font-size:14px"><img class="adapt-img p_image" src="<?=$pic?>" alt="<?=$product['link']?>" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic;border-radius:4px" width="270" title="<?=$product['link']?>"></a></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td class="es-m-txt-l" align="left" style="padding:0;Margin:0;padding-bottom:10px;padding-top:15px"><h2 class="p_name" style="overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    width: 270px;height:56px;Margin:0;line-height:28.8px;mso-line-height-rule:exactly;font-family:'Arial Narrow', Arial, sans-serif;letter-spacing:0.5px;font-size:24px;font-style:normal;font-weight:normal;color:#333333"><a target="_blank" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:none;color:#333333;font-size:24px;" href="<?=$product['link']?>"><?=$product['name']?></a></h2></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td align="left" style="padding:0;Margin:0;padding-bottom:15px"><h3 style="Margin:0;line-height:21.6px;mso-line-height-rule:exactly;font-family:'Arial Narrow', Arial, sans-serif;letter-spacing:0.5px;font-size:18px;font-style:normal;font-weight:normal;color:#0081ff"> <?=floatval($product['creator_commission_percent'])?>%
                            <span  style="color: rgba(252, 70, 3, 1);margin-left: 5px;">
                                <?=$product_sales?> Sold
                            </span></h3></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td align="left" style="padding:0;Margin:0;padding-bottom:15px"><h3 style="color: red;Margin:0;line-height:21.6px;mso-line-height-rule:exactly;font-family:'Arial Narrow', Arial, sans-serif;letter-spacing:0.5px;font-size:18px;font-style:normal;font-weight:normal;">
                            $<?=$arn?> Earn per sale</h3></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td class="es-m-txt-l" align="left" style="padding:0;Margin:0"><!--[if mso]><a href="<?=$product['link']?>" target="_blank">
                            <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" esdevVmlButton href="<?=$product['link']?>"
                                         style="height:48px;v-text-anchor:middle;width:127px;" arcsize="25%" strokecolor="#333333" strokeweight="2px" fillcolor="#333333">
                                <w:anchorlock></w:anchorlock>
                                <center style='color:#ffffff;font-family:arial, "helvetica neue", helvetica, sans-serif;font-size:12px;font-weight:700;'>Get Free Sample</center>
                            </v:roundrect></a>
                        <![endif]--><!--[if !mso]><!-- --><span class="es-button-border msohide" style="border-style:solid;border-color:#333333;background:#333333;border-width:2px;display:inline-block;border-radius:12px;width:auto;letter-spacing:0.5px;mso-hide:all">
                           <a href="<?=$product['link']?>" style="text-underline: none;">
                        <div style="width: 148px;">
                            <div style="line-height:30px;font-size: 12px;    border-radius: 9999px;    cursor: pointer;    position: relative;">
                                <div style="color: #fff;    text-align: center !important;font-weight: 500;    --tw-bg-opacity: 1;background-color: #000;    border-radius: 9999px;    justify-content: center;">
                                    Get Free Sample
                                </div>
                            </div>
                        </div>
                        </a>
                        </span><!--<![endif]--></td>
                </tr>
                </tbody></table></td>
    </tr>
    </tbody></table><!--[if mso]></td></tr></table><![endif]--></td>

